<?php
/**
 * Lista os servidores cadastrados no banco de dados vinculados ao campus/setor informado.
*/

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

SAEO::ValidarAcesso( array( 0, 2 ) );

$campus = new Campus();
$campiCadastradas = $campus->CarregarCampi(); 
?>
<html>
           <head>
           <title>SAEO - Listar servidor</title>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />           
           <script type='text/javascript' src='templates/ajax.js'></script>
           <script type='text/javascript' src='templates/js.js'></script>
           <script type='text/javascript' src='templates/geral.js'></script>
           <script type='text/javascript' src='templates/setor.js'></script>
           <script type='text/javascript' src='templates/servidor.js'></script>
           <script type='text/javascript' src='templates/hintbox.js'></script>
           <script type='text/javascript' src='templates/validacoes.js'></script>
           <link rel='stylesheet' type='text/css' href='templates/estilos.css'/>

           </head>
     <body class='body'>
     <form name='listar_servidores' method='post'>
     <table width='779' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
            <tr>
                <td colspan='2'>
                <?php include "Topo.php"; ?>
                </td>
            </tr>
            <tr>
                <td><div class='titulosTabelas' style='width:779; height:20; background:url(templates/tabela.jpg)'>LISTAR SERVIDORES</div></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td><table class='tabela' width='650' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td class='textoTabelas' width='25%'>&nbsp;Campus:</td>
                               <td class='textoTabelas'>
                                   <select name='campi' id='campi' class='inputTexto' style='width:300px' onchange='MostrarDiv(this.value, document.getElementById("informacaoservidor")); CarregarServidoresPorUnidade(this.value);' > </a>
                                           <option value='0'>Selecione a campus</option>
                                   <?php 
                                   for( $i = 0; $i < count( $campiCadastradas ) ; $i++ )
                                   {
                                   	?>
                                       <option value='<?php echo $campiCadastradas[$i]->id; ?>'><?php echo $campiCadastradas[$i]->nome; ?></option> ";
                                   <?php 
                                   }
									?>
                                   </select>
                                   <a href='#' class='hintanchor' onMouseover='showhint("Escolha a Campus em que o servidor trabalha.", this, event, "220px");'>[?]</a>
                               </td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
<!--                            <tr>
                               <td class='textoTabelas'>&nbsp;Setor: </td>
                               <td class='textoTabelas'>
                               <select name='setores' id='listaSetores' class='inputTexto' onchange='MostrarDiv(this.value, document.getElementById("informacaoservidor")); CarregarServidores(this.value);'>
                                       <option id='setor' value='0'>Primeiro selecione a Campus</option>
                               </select>
                               <a href='#' class='hintanchor' onMouseover='showhint("Escolha o Setor em que o servidor trabalha.", this, event, "220px");'>[?]</a>
                               </td>
                           </tr>  -->
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                           <tr>
                               <td colspan='2'>
                                   <div id='informacaoservidor' style='display:none;'>
                                        <table id='dadosservidor' width='650' border='0' cellpadding='0' align='center' bgcolor='#FFFFFF' class='detalhamento'>
                                               <thead class='detalhamento'>
                                                      <tr>
                                                          <th>Usu&aacute;rio</th>
                                                          <th>Perfil</th>
                                                          <th>CPF</th>
                                                          <th>SIAPE</th>
                                                      </tr>
                                               </thead>
                                               <tbody class='detalhamento' id='corpoServidor'>
                                               </tbody>
                                        </table>
                                   </div>
                               </td>
                           </tr>
                           <tr>
                               <td colspan='2'>&nbsp;</td>
                           </tr>
                     </table>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tfoot>
           <tr>
                <td colspan='2'>&nbsp;</td>
            </tr>
                   <tr>
                       <?php include 'rodapeCreditos.php'; ?>
            	   </tr>
            </tfoot>
     </table>
     </body>
     </html>